package lcr;

public class Test0004 {
    public static void main(String[] args) {
        int[] nums={2,2,2};
        System.out.println(new Solution0004_1().singleNumber(nums));
    }
}

class Solution0004_1 {
    public int singleNumber(int[] nums) {
        int ans=0,temp=0;
        for(int i=0;i<nums.length;i++){
            ans=ans^nums[i]&~temp;
            temp=temp^nums[i]&~ans;
        }
        return ans;
    }
}